package com.hqx.oop.constructor;

public class ConstructorTest {

    private int a;
    private double b;
    private String str;

    ConstructorTest() {
        System.out.println("无参构造方法");
    }

    ConstructorTest(int a) {
        this();
        this.a = a;
        System.out.println("int");
    }

    ConstructorTest(double b,String str) {
        this(1);
        this.b = b;
        this.str = str;
        System.out.println("double and String ");
    }

    public static void main(String[] args) {
        ConstructorTest ct = new ConstructorTest(1.5,"哈哈");
        System.out.println(ct.a+"\t"+ct.b+"\t"+ct.str);
    }
}
